<?php
declare (strict_types=1);

use think\facade\Route;

//商品专区
Route::group('productType', function () {
    Route::get('/index', 'productType/index');
    Route::get('/getList', 'productType/getList');
    Route::get('/add', 'productType/add');
    Route::get('/edit', 'productType/edit');
    Route::post('/save', 'productType/save');
    Route::post('/update', 'productType/update');
    Route::post('/delete', 'productType/delete');
})->middleware('verify');

//商品分类
Route::group('productCate', function () {
    Route::get('/index', 'productCate/index');
    Route::get('/getList', 'productCate/getList');
    Route::get('/add', 'productCate/add');
    Route::get('/edit', 'productCate/edit');
    Route::post('/save', 'productCate/save');
    Route::rule('/update', 'productCate/update');
    Route::post('/delete', 'productCate/delete');
    Route::get('/getCate', 'productCate/getCate');
})->middleware('verify');

//商品规格
Route::group('spec', function () {
    Route::get('/index', 'spec/index');
    Route::get('/getList', 'spec/getList');
    Route::get('/add', 'spec/add');
    Route::get('/edit', 'spec/edit');
    Route::post('/save', 'spec/save');
    Route::rule('/update', 'spec/update');
    Route::post('/delete', 'spec/delete');
    Route::get('/getSpec', 'spec/getSpec');
})->middleware('verify');

//商品列表
Route::group('product', function () {
    Route::get('/index', 'product/index');
    Route::get('/getList', 'product/getList');
    Route::get('/add', 'product/add');
    Route::get('/edit', 'product/edit');
    Route::get('/getSpecOptions', 'product/getSpecOptions');
    Route::post('/save', 'product/save');
    Route::rule('/update', 'product/update');
    Route::post('/delete', 'product/delete');
})->middleware('verify');

//订单管理
Route::group('order', function () {
    Route::get('/index', 'order/index');
    Route::get('/getList', 'order/getList');
    Route::get('/edit', 'order/edit');
    Route::post('/delete', 'order/delete');
    Route::rule('/address', 'order/address', 'get|post');
    Route::rule('/deliver', 'order/deliver', 'get|post');
    Route::get('/exportOrder', 'order/exportOrder');
    Route::post('/importDeliver', 'order/importDeliver');
})->middleware('verify');
